__author__ = 'seamus and arman'

import unittest
from ChessBoard import *

# <summary>
# Unittests written for checking the method AddTextMove()
# of class ChessBoard.
# </summary>
# <owners>Seamus;Arman</owners>
class TestCanAddTextMove(unittest.TestCase):

    # <summary>
    # Creates the chess board, and resets it
    # </summary>
    # <owners>Seamus;Arman</owners>
    def setUp(self):
        self.chessboard = ChessBoard()
        self.chessboard.resetBoard()

    # <summary>
    # Teardown method, assigns chessboard to 'None'
    # </summary>
    # <owners>Seamus;Arman</owners>
    def tearDown(self):
        self.chessboard = None


    # <summary>
    # Feeding invalid input - Checking with False flag
    # </summary>
    # <owners>Seamus;Arman</owners>
    def testInvalidTextInput(self):
        move = 'zz0010zz'
        self.assertFalse(self.chessboard.addTextMove(move))

    
    # <summary>
    # Feeding valid input - Checking with True flag
    # </summary>
    # <owners>Seamus;Arman</owners>
    def testValidTextInput(self):
	move = 'e2e4'
	self.assertTrue(self.chessboard.addTextMove(move))


    # <summary>
    # Feeding valid input - Checking with True flag
    # </summary>
    # <owners>Seamus;Arman</owners>
    def testNoTextInput(self):
	move = 3
	self.assertFalse(self.chessboard.addTextMove(move))


if __name__ == "__main__":
    unittest.main()
